new Vue({
	el: '#app',
	data() {
		return {
			tableData: [{
				e_aId: '1',
				e_aType: 'sun',
				e_aContent: '200',
				startTime: '2016-05-02',
				endTime: '2016-05-02',
				e_aStatus: '1',
			}]			
		}
	},
	created() {
		this.e_aAjax();
	},
	methods: {
				e_aAjax: function() {
					var self = this;
					var xml = window.XMLHttpRequest ? new XMLHttpRequest() : ActiveXObject("microsoft.XMLHttp");
					xml.open("get", "http://www.oa.com/e_a/selectAll", true);
					xml.send();
					xml.onreadystatechange = function() {
						if (xml.readyState == 4 && xml.status == 200) {
							var x = xml.responseText;
							self.tableData = JSON.parse(x);
							console.log(x)
						}
					};
				},	
				handleEdit(index, row) {
					var str=window.location.href
					str="e_a_edit.html?e_aId="+row.e_aId+"&e_aType="+row.e_aType+"&e_aContent="+row.e_aContent
					+"&startTime="+row.startTime+"&endTime="+row.endTime;
					location=str;
				},
				handleDelete(index, row) {
					var xml = window.XMLHttpRequest ? new XMLHttpRequest() : ActiveXObject("microsoft.XMLHttp");
					xml.open("get", "http://www.oa.com/e_a/deleteorder", true);
					xml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
					xml.send("e_aId="+row.e_aId);
					xml.onreadystatechange = function() {
						if (xml.readyState == 4 && xml.status == 200) {
							var x = xml.responseText;
							self.tableData = JSON.parse(x);
							console.log(x)
						}
					};
				}
	}

})
